import React, { Component } from 'react'
import { useParams, useLocation } from 'react-router-dom'
export default function Detail() {
  const { id } = useParams()
  const { state } = useLocation()
  return (
    <h5>
      {/* detail的内容~~~{id},{state && state.xxx} */}
      {/* 下面的代码是es10新出的语法: 叫做可选链 */}
      detail的内容~~~{id},{state?.xxx}
    </h5>
  )
}
